<!DOCTYPE html>
<html lang="zh">

	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title>文件上传 （带进度条）</title>
		<link rel="stylesheet" type="text/css" href="css/uploadself.css"/>
	</head>
	<body>
		<div class="fileupload"></div>
		<span id="txtname"></span>
		<div class="sub">上传</div>
	</body>
	<script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>
	<script src="js/uploadself.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		$(".fileupload").filesUpload({
			url:'http://up.qiniu.com',//上传地址
			multiple: true,  //是否多文件上传
			accept: '', //input accept属性
			fileTypes:'png,webp,mp4,docx,jpg',//文件格式
			buttonText: '选择文件',  //按钮文字
			autoUpload:'.sub',
			fileChangeEnd:function(file){
				console.log("文件",file);
				$("#txtname").text(file[0].name);
				
			},
			onUploadStart: function() {}, //请求开始
			onUploadSuccess: function(a,b) {
				console.log(a,b)
			},//请求成功
			onUploadComplete: function() {},//请求完成
			onUploadError:function(res, xhr){//请求错误
				console.log("err",res,xhr)
			}
		})
	</script>

</html>